package com.android.hedgehog.puzzles;

import android.graphics.Color;

import com.android.hedgehog.GameScreen;
import com.android.hedgehog.framework.Graphics;

public class DecipherScreen extends GameScreen {
	Graphics graphics;
	DecipherWords wordbank;
	
	private enum GameState {
		Ready, Running, Input, Result
	}
	
	double bufferTime = 0.5;
	boolean[] clearLine;
	
	public DecipherScreen(Graphics graphics, int difficulty) {
		wordbank = new DecipherWords(difficulty);
		this.graphics = graphics;
		clearLine = new boolean[56];
	}

	@Override
	public int update(int x, int y, int score, double time) {
		if (time > bufferTime) {
			clearLine[(int) (Math.random() * 56)] = true;
			bufferTime += 0.5;
		}

		return 0;
	}

	@Override
	public void present() {
		for(int i =0;i<wordbank.wordlength;i++){
			graphics.drawSpecialText(""+wordbank.dc.letter[i], 50+(i*20), 156, 32, wordbank.dc.style[i], Color.WHITE);
		}
		//graphics.drawText(wordbank.answerString, 160, 156, 36, Color.WHITE);
		graphics.drawLine(60, 102, 260, 102, Color.BLUE);
		/*for (int i = 100; i < 156; i++) {
			if (clearLine[i - 100] == false)
				graphics.drawLine(60, i, 260, i, Color.DKGRAY);
		}*/
		for(int i=0;i<wordbank.totalChoices;i++){
			graphics.drawText(wordbank.choices[i], 160, 180+(20*i), 16, Color.WHITE);
		}

	}

}
